home *** CD-ROM | disk | FTP | other *** search
- (*===========================================================================*)
- (* Procedure to give status of channel queuing *)
- (* *)
- (* Copyright 1988, 1989, 1991 by H. Roy Engehausen. All rights reserved. *)
- (* *)
- (* This software may be freely distributed and used, but it may not *)
- (* under any circumstances be sold by anyone other than the author. *)
- (* It may be distributed by a commercial company as long as it is *)
- (* for no cost. *)
- (* *)
- (*===========================================================================*)
-
- (*===========================================================================*)
- (* Check pending *)
- (* *)
- (* Checks for pending data for this channel. Used by PK232 to hold *)
- (* data received on wrong channel. Used by MODEM to hold data since *)
- (* not host mode *)
- (*===========================================================================*)
-
- FUNCTION pending_chain(type_to_check : BYTE) : BYTE;
-
- VAR
- i : BYTE;
- look_chain : str_m_chain;
-
- BEGIN;
-
- look_chain := active_tcb^.tnc_in_chn;
-
- i := 0;
-
- (*-----------------------------------------------------------------------*)
- (* Just search down the chain and see if we have an answer to the *)
- (* type of poll wanted *)
- (*-----------------------------------------------------------------------*)
-
- WHILE (look_chain <> NIL) AND (i < 64) DO
- BEGIN;
-
- {$IFDEF POINT_CHK}
- test_pointer(look_chain);
- {$ENDIF}
-
- IF (active_tcb^.channel = look_chain^.str_m_chan)
- AND ((type_to_check = 2)
- OR ((type_to_check = 3)
- AND (look_chain^.str_m_type >= t_to_h_mh_noi))
- OR ((type_to_check = 4)
- AND (look_chain^.str_m_type < t_to_h_mh_noi)))
- THEN
- INC(i);
-
- look_chain := look_chain^.str_m_next;
-
- END;
-
- pending_chain := i;
-
- END;